package cn.buddie.spidemo;

import java.util.Iterator;
import java.util.ServiceLoader;

public class SPIMain {

	public static void main(String[] args) {
		ServiceLoader<IHelloService> serviceLoader  = ServiceLoader.load(IHelloService.class);
		Iterator<IHelloService> iteratorSPI = serviceLoader.iterator();
		IHelloService spi;
		while(iteratorSPI.hasNext()) {
			spi = iteratorSPI.next();
			spi.sayHello();
		}
	}
}
